package helpers;

import java.io.Serializable;

/**
 * Class for Interpolation calculations
 * @author BaciL
 */

public class Interpolator implements Serializable
{
	/**
	 * Simple method, which gives u value of Y for your X, between two Y values
	 * X = <0,1.0>
	 * @param x
	 * @param y1
	 * @param y2
	 * @return
	 */
	public static double CosineInterpolate(double x, double y1, double y2)
	{
		double x2;

		x2 = (1-Math.cos(x*Math.PI))/2;
		return(y1*(1-x2)+y2*x2);
	}	
}